package com.buddy.learn.javasource._thread;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author Buddy
 * @date 2021/5/10
 */
public class _Thread {

    public static void main(String[] args) throws InterruptedException, ExecutionException {
        Thread thread = new Thread();
        thread.setContextClassLoader(new ClassLoader() {
            @Override
            public Class<?> loadClass(String name) throws ClassNotFoundException {
                return super.loadClass(name);
            }
        });
        thread.setPriority(1);
        thread.start();
        thread.join();
        FutureTask<String> futureTask = new FutureTask<>(() -> "111111");
        futureTask.run();
        System.out.println(futureTask.get());
        futureTask.cancel(true);

        InheritableThreadLocal inheritableThreadLocal = new InheritableThreadLocal();
    }

}
